<template>
  <el-aside :width="isZhank ? '64px':'15%'">
    <div class="toggle-button" @click="toggleZhankai">|||</div>
    <el-menu
      class="el-menu-vertical-demo"
      background-color="#333744"
      text-color="#fff"
      active-text-color="#409EFF"
      :collapse="isZhank"
      :collapse-transition="false"
      :router="true"
      :default-active="$route.path"
    >
      <el-submenu index="1-11">
        <template slot="title">
          <i class="el-icon-location"></i>
          <span>成果填报</span>
        </template>
        <el-menu-item index="/shiList">
          <template slot="title">
            <i class="el-icon-s-flag"></i>
            <span>矢量成果</span>
          </template>
        </el-menu-item>
        <el-menu-item index="/wenList">
          <template slot="title">
            <i class="el-icon-s-management"></i>
            <span>文本成果</span>
          </template>
        </el-menu-item>
        <el-menu-item index="/tuList">
          <template slot="title">
            <i class="el-icon-picture"></i>
            <span>图集成果</span>
          </template>
        </el-menu-item>
        <el-menu-item index="/yanList">
          <template slot="title">
            <i class="el-icon-s-marketing"></i>
            <span>研究报告</span>
          </template>
        </el-menu-item>
      </el-submenu>
      <el-submenu index="2-2">
        <template slot="title">
          <i class="el-icon-menu"></i>
          <span slot="title">成果审核</span>
        </template>
        <el-menu-item :index="item.id + ''" v-for="item in shiList" :key="item.id">
          <template slot="title">
            <i class="el-icon-s-flag"></i>
            <span>{{item.name}}</span>
          </template>
        </el-menu-item>
      </el-submenu>
    </el-menu>
  </el-aside>
</template>

<script>
  export default {
    name: 'tianBaoLeft',
    data(){
      return {
        isZhank: false,
        shiList: [],
      }
    },
    created () {
      this.getShiMeau()
    },
    methods: {
      async getShiMeau () {
       /* const { data: res } = await this.$http.get('qhCode/loginUserAuthCode')
        console.log(res)
        if (res.status !== '1000') {
          return this.$message.error(res.msg)
        }
        this.shiList = res.data*/
      },
      toggleZhankai () {
        this.isZhank = !this.isZhank
      },

    },
  }
</script>

<style lang="less" scoped>
  .toggle-button {
    background-color: #4a5064;
    font-size: 10px;
    line-height: 24px;
    color: #fff;
    text-align: center;
    letter-spacing: 0.2em;
    cursor: pointer;
  }
  .el-aside {
    background-color: #333744;

    .el-menu {
      border-right: 0;
    }
  }
</style>
